package org.lanqiao.tjut.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.lanqiao.tjut.bean.OpeBean;
import org.lanqiao.tjut.dao.OpeDao;
import org.lanqiao.tjut.mapper.OpeBeanMapper;
import org.springframework.stereotype.Repository;

@Repository("OpeInfoDao")
public class OpeInfoDao implements OpeDao {
	@Resource
	private OpeBeanMapper opeMapper;

	@Override
	public OpeBean selectByOpeIndex(String opreatorIndex) {
		// 根据主键查询该操作员所有信息
		OpeBean opeB = opeMapper.selectByOpeIndex(opreatorIndex);
		return opeB;
	}

	@Override
	public OpeBean selectByOpeAccount(String opreatorAccount) {
		// 根据账号查询该操作员所有信息
		OpeBean opeB = opeMapper.selectByOpeAccount(opreatorAccount);
		return opeB;
	}

	@Override
	public List<OpeBean> selectAllOpes() {
		// 查询所有操作员信息
		List<OpeBean> lstOpe = opeMapper.selectAllOpes();
		return lstOpe;
	}

	@Override
	public int insertOpeInfo(OpeBean opeB) {
		// 添加操作员信息
		int i = opeMapper.insertOpeInfo(opeB);
		return i;
	}

	@Override
	public int updateOpeByIndex(OpeBean opeB) {
		// 修改操作员信息（根据主键序号）
		int i = opeMapper.updateOpeByIndex(opeB);
		return i;
	}

	@Override
	public List<OpeBean> selectOpeInfoDynamic(OpeBean opeB) {
		// 动态查询操作员信息
		List<OpeBean> lstOpe = opeMapper.selectOpeInfoDynamic(opeB);
		return lstOpe;
	}

	@Override
	public int deleteByOpeIndex(OpeBean opeB) {
		// 根据主键序号删除对象
		int i = opeMapper.deleteByOpeIndex(opeB);
		return i;
	}

	@Override
	public OpeBean selectByOpeName(String opreatorName) {
		// 根据姓名查询操作员对象
		return opeMapper.selectByOpeName(opreatorName);
	}

}
